<div class="modal-dialog">
  <div class="modal-content">
    <div class="modal-header">
      <h4 class="modal-title">
        <%= data.modalTitle %>
      </h4>
      <button type="button" class="close" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">×</span>
      </button>
    </div>



    <!-- 新增广告表单 -->
    <form name="addAdvForm" class="form-horizontal" id="addAdvForm">
      <div class="card-body">
        <div class="form-group row">
          <label class="col-sm-2 col-form-label" for="advTitle">标题：</label>
          <div class="col-sm-10">
            <input id="advTitle" name="title" type="text" class="form-control" value="<%= data.title || ''  %>"
              placeholder="请输入广告标题">
          </div>
        </div>
        <div class="form-group row">
          <label class="col-sm-2 col-form-label" for="advType">类别:</label>
          <div class="col-sm-10">
            <select name="type" id="advType" class="form-control">
              <option value="1" selected="<%= data.type === 1 %>">轮播图广告</option>
              <option value="2" selected="<%= data.type === 2 %>">轮播图底部广告</option>
              <option value="3" selected="<%= data.type === 3 %>">热门回收广告</option>
              <option value="4" selected="<%= data.type === 4 %>">优品精选广告</option>
            </select>
          </div>
        </div>
        <div class="form-group row">
          <label class="col-sm-2 col-form-label" for="advHref">链接：</label>
          <div class="col-sm-10">
            <input id="advHref" name="href" value="<%= data.href || '' %>" type="text" class="form-control"
              placeholder="请输入广告链接">
          </div>
        </div>
        <div class="form-group row">
          <label class="col-sm-2 col-form-label" for="orderNum">排序：</label>
          <div class="col-sm-10">
            <input id="orderNum" name="order" value="<%= data.order || '' %>" type="text" class="form-control"
              placeholder="请输入广告排序，数字越大越靠前">
          </div>
        </div>


        <div class="form-group row">
          <label class="col-sm-2 col-form-label" for="advPic">图片：</label>
          <div class="col-sm-10 custom-file">
            <!--  可以选择多个文件上传                          -->
            <!--  <input multiple type="file" class="form-control" name="advPic" id="advPic">-->
            <!--  可以选择一个文件上传                          -->
            <input type="file" class="form-control" name="pic" id="advPic" value="<%= data.fileName || '' %>">
          </div>
        </div>
        <div>
          <% if(data.src){%>
            <img style="display: block;" id="preImg" height="100" src="<%= /server/data.src %>">
            <%} else{%>
              <img style="display: none;" id="preImg" height="100">
              <% } %>

        </div>

      </div>
    </form>

    <div class="modal-footer justify-content-between">
      <button type="button" class="btn btn-default" id="adv-cancel" data-dismiss="modal">取消</button>
      <button type="submit" class="btn btn-primary" id="adv-save" form="addAdvForm">提交</button>
    </div>



  </div>
  <!-- /.modal-content -->
</div>